<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<title>全选</title>
		<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>
	</head>
	<body>
		<table border="1" width="300" height="200">
			<tr>
				<td><input id="selectAll" type="checkbox">全选</td>
				<td>编号</td>
				<td>用户名</td>
				<td>密码</td>
			</tr>
			<tr>
				<td><input type="checkbox" class="sel"></td>
				<td>1</td>
				<td>zhangsan</td>
				<td>123</td>
			</tr>
			
			<tr>
				<td><input type="checkbox" class="sel"></td>
				<td>2</td>
				<td>lisi</td>
				<td>123123</td>
			</tr>
			
			<tr>
				<td><input type="checkbox" class="sel"></td>
				<td>3</td>
				<td>wangwu</td>
				<td>12312421</td>
			</tr>
			<script type="text/javascript">
				
					$("#selectAll").click(function(){
						$(".sel").prop("checked",$(this).prop("checked"));
					});
			
				
			</script>
			
		</table>
	</body>
</html>
